<?php
$query="SELECT * FROM tbl_news ORDER BY id DESC";
$rows=Db::mysql_query($query,Config::$FETCH_MODE_TABLE);
?>
<table class='table-administrator'>
	<thead>
		<tr>
			<td>STT</td>
			<td>Hình minh họa</td>
			<td>Tiêu đề</td>			
			<td>Trích dẫn</td>
			<td>Quản lý</td>
		</tr>
	</thead>
	<tbody>
		<?php foreach ($rows as $key=>$row){?>
		<tr>
			<td>
				<?php echo $key+1;?>
			</td>
			<td>
				<?php $image=$row['image']!=""?$row['image']:'app.png';?>
				<img style="width: 100px" src='<?php echo $image;?>'/>			
			</td>
			<td>
				<?php echo $row['title'];?>
			</td>
			<td>
				<?php echo $row['quote'];?>
			</td>
			<td>
				<a href='index.php?page=news-update&id=<?php echo $row['id'];?>'>Sửa</a>
				<a href='index.php?page=news-delete&id=<?php echo $row['id'];?>' onclick="if(!confirm('Bạn có đồng xóa không?')){return false;}">Xóa</a>
			</td>
		</tr>
		<?php }?>
	</tbody>
</table>